package com.party.core.model.analysis;

import com.party.core.model.BaseModel;

import java.io.Serializable;

/**
 * @program: party-temp
 * @description: 统计事件
 * @author: Huaqunhao
 * @create: 2018-07-31 19:00
 **/
public class StatisticsEvent extends BaseModel implements Serializable {
    private static final long serialVersionUID = 4522623136900346126L;

    public static final Integer TYPE_WEB = 1; // 网页端
    public static final Integer TYPE_MOBILE = 2; // 移动端

    //DB
    //事件名称
    private String name;
    //事件编码
    private String code;
    // 事件类型
    private Integer type;

    //business
    //当日触发数
    private Long eventNum;
    //当日用户触发数
    private Long onUserEventNum;
    //搜索关键字
    private String keyword;

    //机构名称
    private String partnerName;

    public String getPartnerName() {
        return partnerName;
    }

    public void setPartnerName(String partnerName) {
        this.partnerName = partnerName;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Long getEventNum() {
        return eventNum;
    }

    public void setEventNum(Long eventNum) {
        this.eventNum = eventNum;
    }

    public Long getOnUserEventNum() {
        return onUserEventNum;
    }

    public void setOnUserEventNum(Long onUserEventNum) {
        this.onUserEventNum = onUserEventNum;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        StatisticsEvent that = (StatisticsEvent) o;

        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (eventNum != null ? !eventNum.equals(that.eventNum) : that.eventNum != null) return false;
        if (onUserEventNum != null ? !onUserEventNum.equals(that.onUserEventNum) : that.onUserEventNum != null)
            return false;
        return keyword != null ? keyword.equals(that.keyword) : that.keyword == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (eventNum != null ? eventNum.hashCode() : 0);
        result = 31 * result + (onUserEventNum != null ? onUserEventNum.hashCode() : 0);
        result = 31 * result + (keyword != null ? keyword.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "StatisticsEvent{" +
                "name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", eventNum=" + eventNum +
                ", onUserEventNum=" + onUserEventNum +
                ", keyword='" + keyword + '\'' +
                '}';
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
